import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String s = scanner.next();
        int len = s.length();
        int res1 = 0;
        for (char c : s.toCharArray()) {
            if (c == '0') {
                res1 += 1;
            }
        }
        res1 = Math.min(res1, (len - res1));

        int res2 = 0;
        for (int i = 0; i <= len / 2; i++) {
            char c = s.charAt(i);
            if (c != '1') {
                res2 += 1;
            }
        }
        for (int i = len / 2 + 1; i < len; i++) {
            char c = s.charAt(i);
            if (c != '0') {
                res2 += 1;
            }
        }
        int res = Math.min(res1, res2);
        System.out.println(res);
    }
}